package com.droid.lib.controls.demo.util;


import android.annotation.SuppressLint;
import android.content.Context;
import android.util.TypedValue;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;

import com.droid.lib.controls.demo.R;

/**
 * 动画处理类
 * @author Administrator
 *
 */
@SuppressLint("InlinedApi")
public class BroadLessUtils {
	public static void dismissKeyboard(Context context, EditText editText) {
		InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
		imm.hideSoftInputFromWindow(editText.getWindowToken(), 0);
	}

	public static View setBackgroundBroadLess(Context context, View view) {
		TypedValue outValue = new TypedValue();
		context.getTheme().resolveAttribute(android.R.attr.selectableItemBackground, outValue, true);
//		view.setBackgroundResource(outValue.resourceId);

		view.setBackgroundResource(R.drawable.selector_connect);
		return view;
	}

	public static View setBackgroundBroad(Context context, View view) {
		TypedValue outValue = new TypedValue();
		context.getTheme().resolveAttribute(android.R.attr.selectableItemBackground, outValue, true);
		view.setBackgroundResource(outValue.resourceId);
		return view;
	}
}
